// const { notEmpty } = require('../utils.js')

module.exports = {
  description: '创建vue-router模块',
  prompts: [],
  actions: data => {
    // const name = '{{properCase name}}'
    const routeList = [
      {
        urlName: 'worktable',
        routeName: 'worktable',
        pathName: 'worktable',
        title: '工作台'
      },
      {
        urlName: 'pointmanage',
        routeName: 'pointmanage',
        pathName: 'pointmanage',
        title: '机构管理'
      },
      {
        urlName: 'workarea',
        routeName: 'workarea',
        pathName: 'workarea',
        title: '机构作业范围'
      },
      {
        urlName: 'paymanage',
        routeName: 'paymanage',
        pathName: 'paymanage',
        title: '运费管理'
      },
      {
        urlName: 'cartypemanage',
        routeName: 'cartypemanage',
        pathName: 'cartypemanage',
        title: '车型管理'
      },
      {
        urlName: 'carlist',
        routeName: 'carlist',
        pathName: 'carlist',
        title: '车辆列表'
      },
      {
        urlName: 'carback',
        routeName: 'carback',
        pathName: 'carback',
        title: '回车登记'
      },
      {
        urlName: 'postmanmanage',
        routeName: 'postmanmanage',
        pathName: 'postmanmanage',
        title: '快递员管理'
      },
      {
        urlName: 'driver',
        routeName: 'driver',
        pathName: 'driver',
        title: '司机管理'
      },
      {
        urlName: 'scheduling',
        routeName: 'scheduling',
        pathName: 'scheduling',
        title: '排班管理'
      },
      {
        urlName: 'ordermanage',
        routeName: 'ordermanage',
        pathName: 'ordermanage',
        title: '订单管理'
      },
      {
        urlName: 'sendlistmanage',
        routeName: 'sendlistmanage',
        pathName: 'sendlistmanage',
        title: '运单管理'
      },
      {
        urlName: 'sendtask',
        routeName: 'sendtask',
        pathName: 'sendtask',
        title: '运输任务管理'
      },
      {
        urlName: 'line',
        routeName: 'line',
        pathName: 'line',
        title: '线路管理'
      },
      {
        urlName: 'get',
        routeName: 'get',
        pathName: 'get',
        title: '取件作业管理'
      },
      {
        urlName: 'outsend',
        routeName: 'outsend',
        pathName: 'outsend',
        title: '派件作业管理'
      }
    ]
    console.log(routeList)
    // const actions = [{
    //   type: 'add',
    //   path: `src/components/${name}/index.vue`,
    //   templateFile: 'plop-templates/component/index.hbs',
    //   datamanage: {
    //     name: name,
    //     template: datamanage.blocks.includes('template'),
    //     script: datamanage.blocks.includes('script'),
    //     style: datamanage.blocks.includes('style')
    //   }
    // }]

    return routeList.map(item => {
      return {
        type: 'add',
        path: `src/router/modules/${item.pathName}.js`,
        templateFile: 'plop-templates/router/index.hbs',
        data: {
          ...item
        }
      }
    })
  }
}
